package ch.supsi.template.listremove;

import java.util.ArrayList;

public class MyList<T> extends ArrayList<T> {
    @Override
    public boolean remove(Object o) {
        boolean atLeastOneDeleted = false;
        if (o != null) {
            for (int i = size() - 1; i >= 0; i--) {
                if (o.equals(get(i))) {
                    remove(i);
                    atLeastOneDeleted = true;
                }
            }
        }

        return atLeastOneDeleted;
    }
}
